//
//  ViewController.m
//  SLTabBarVc_NavigationVc
//
//  Created by 伟仔c on 15/4/6.
//  Copyright (c) 2015年 SL. All rights reserved.
//

#import "ViewController.h"
#import "SLTabBarController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //    NSArray *images = @[@"TabBar1", @"TabBar2", @"TabBar3", @"TabBar4", @"TabBar5"];
    
    //    NSArray *seelctedImages = @[@"TabBar1Sel", @"TabBar2Sel", @"TabBar3Sel", @"TabBar4Sel", @"TabBar5Sel"];
    
    
    NSArray *titles = @[@"title1", @"title2", @"title3", @"title4", @"title5"];
    
    NSArray *images = @[@"TabBar11", @"TabBar22", @"TabBar33", @"TabBar44", @"TabBar55"];
    
    NSArray *seelctedImages = @[@"TabBar11Sel", @"TabBar22Sel", @"TabBar33Sel", @"TabBar44Sel", @"TabBar55Sel"];
    
    UIViewController *vc1 = [[UIViewController alloc] init];
    UIViewController *vc2 = [[UIViewController alloc] init];
    UIViewController *vc3 = [[UIViewController alloc] init];
    UIViewController *vc4 = [[UIViewController alloc] init];
    UIViewController *vc5 = [[UIViewController alloc] init];
    NSArray *controllers = @[vc1, vc2, vc3, vc4, vc5];
    
    /*******核心代码********/
    SLTabBarController *tabBarVc = [SLTabBarController tabBarViewControllerWithTitles:titles images:images selectedImages:seelctedImages controllers:controllers];
    
    tabBarVc.view.frame = self.view.frame;
    [self addChildViewController:tabBarVc];
    [self.view addSubview:tabBarVc.view];
    /*******核心代码********/
}

@end
